
        <HTML>
		<HEAD>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<meta name="description" content="Flash MX 2004 ActionScript2.0 Library: Format - Wright Internet Solutions">
		<meta name="keywords" content="Format,Flash,MX,2004,ActionScript,ActionScript2.0,AS2.0 Library,AS2,AS2 Library,Wright Internet Solutions,Wright,class,documentation,methods,functions,interfaces,JavaScript,Java">
		<TITLE>WIS AS2 Library : com.wis.math.num.Format Documentation</TITLE>

		<STYLE><!--
		HR.small{height:1px; width:100%; background:#E7BFA3; border: 0px;}
		HR.big{height:4px; width:100%; background:#E7BFA3; border: 0px;}
		A:hover{text-decoration: underline}
		A{text-decoration: none; color: #993333}
		code{font-family: monospace; font-size: 12px; color: #666666;}
		.methodAttributesTitle{font-size: 12px; font-weight: bold; color: #7B779C}
		.ToC{font-size: 12px; font-weight: bold; color: #993333}
		.methodTitle{font-size: 14px; font-weight: bold; color: #993333}
		.groupTitle{font-size: 18px; font-weight: bold; color: #993333}
		.sectionTitle{font-size: 22px; font-weight: bold; color: #993333}
		.majorTitle{font-size: 32px; font-weight: bold; color: #993333; padding-bottom:100px;}
		.methodsDiv{margin-left:40px;}
		.footer{font-size: 11px; color: #666666;}
		body{font-family: arial,sans-serif; font-size: 12px;}
		//--></STYLE>

		</HEAD>
		<BODY bgColor='#ffffcc'>
		<P class='majorTitle'>com.wis.math.num.Format Documentation</P>


		<P><B>Author:</B> <a href='mailto:wisolutions2002@shaw.ca?subject=wisASLibrary Format Class'>Richard Wright</a><BR>
		<B>Last Modified:</B> 07/17/04 18:25:47<HR class='big'>

		<P class='sectionTitle'>Summary</P>
		<P class='ToC'>com.wis.math.num.Format class:</P>
		<div class='methodsDiv'><a href='#classinfo'>- description</a></div>
<P class='ToC'>com.wis.math.num.Format Properties:</P><div class='methodsDiv'>
<a href='#none'>- none</a><br>
</div><br>
<P class='ToC'>com.wis.math.num.Format Methods:</P><div class='methodsDiv'>
<a href='# sign'>-  sign</a><br>
<a href='# placesRound'>-  placesRound</a><br>
<a href='# randomBetween'>-  randomBetween</a><br>
<a href='# product'>-  product</a><br>
<a href='# sum'>-  sum</a><br>
<a href='# fp'>-  fp</a><br>
<a href='# maxSort'>-  maxSort</a><br>
<a href='# minSort'>-  minSort</a><br>
<a href='# isEven'>-  isEven</a><br>
<a href='# isOdd'>-  isOdd</a><br>
<a href='# dbleEpsilon'>-  dbleEpsilon</a><br>
<a href='# round2'>-  round2</a><br>
<a href='# formatDecimals'>-  formatDecimals</a><br>
<a href='# toScientific'>-  toScientific</a><br>
<a href='# numCurrency'>-  numCurrency</a><br>
<a href='# numCurrency2'>-  numCurrency2</a><br>
</div><br>

		<HR class='big'>
		<P class='sectionTitle'><A name='classinfo'></A>com.wis.math.num.Format <I>class</I></P>
		<P> <span class='methodTitle'>version:</span> 1.6</P>
		<P class="methodTitle">description:</P>
		<P>Implements the static behaviours of the Format Class.
 <p>
 </P>
		<P class="methodTitle">usage:</P> <pre>Format.classMethod(classProp);</pre>

<P> <span class='methodTitle'>parameters:</span>
				<ul>
<li>      none  -- no class input parameters.</li>
</ul>

			<HR class='small'>
			<P class='groupTitle'><A name='properties'></A>com.wis.math.num.Format Properties:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name='none'></A><u> none</u></P>
				<P> -- no class properties.</P>
</div>

			<HR class='small'>
			<P class='groupTitle'><A name='methods'></A>com.wis.math.num.Format Methods:</P>
			<div class='methodsDiv' >


				<P class='methodTitle'><A name=' sign'></A><u>  sign</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the sign of the number.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.sign(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the sign of the number.
    </P>

				<P class='methodTitle'><A name=' placesRound'></A><u>  placesRound</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Rounds 'a' to 'b' number of decimal places.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.placesRound(a,b);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  a   (Number)  -- a real number.</li>
<li>  b   (Number)  -- a positive integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns a number rounded to 'b' decimal places.
    </P>

				<P class='methodTitle'><A name=' randomBetween'></A><u>  randomBetween</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines a random number between 'a' and 'b'.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.randomBetween(a,b);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  a   (Number)  -- a real number.</li>
<li>  b   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns a random number between 'a' and 'b'.
    </P>

				<P class='methodTitle'><A name=' product'></A><u>  product</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Calculates the product of 'arr' elements.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.product(arr);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  arr   (Array)  -- a list of real numbers.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the product of 'arr' elements.
    </P>

				<P class='methodTitle'><A name=' sum'></A><u>  sum</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Calculates the sum of 'arr' elements.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.sum(arr);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  arr   (Array)  -- a list of real numbers.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the sum of 'arr' elements.
    </P>

				<P class='methodTitle'><A name=' fp'></A><u>  fp</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the decimal portion of a floating point number.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.fp(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns the decimal portion of a floating point number.
    </P>

				<P class='methodTitle'><A name=' maxSort'></A><u>  maxSort</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Definess max of 'arr', or max2min order of 'arr' if 'bList'
     is passed.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.maxSort(arr,bList);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  arr   (Array)  -- a list of real numbers.</li>
<li>  bList   (Boolean)  -- optional Boolean to define return.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Array)  -- returns max of 'arr', or max2min order of 'arr' if 'bList' is passed.
    </P>

				<P class='methodTitle'><A name=' minSort'></A><u>  minSort</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines min of 'arr', or min2max order of 'arr' if 'bList'
     is passed.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.minSort(arr,bList);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  arr   (Array)  -- a list of real numbers.</li>
<li>  bList   (Boolean)  -- optional Boolean to define return.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Array)  -- returns min of 'arr', or min2max order of 'arr' if 'bList' is passed.
    </P>

				<P class='methodTitle'><A name=' isEven'></A><u>  isEven</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Boolean for 'isEven' integer condition.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.isEven(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a positive or negative integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Boolean)
    </P>

				<P class='methodTitle'><A name=' isOdd'></A><u>  isOdd</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Boolean for 'isOdd' integer condition.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.isOdd(n);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  n   (Number)  -- a positive or negative integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Boolean)
    </P>

				<P class='methodTitle'><A name=' dbleEpsilon'></A><u>  dbleEpsilon</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Defines the smallest number such that 1 + mchEps > 1.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.dbleEpsilon();</pre>
     </P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns machine precision.
    </P>

				<P class='methodTitle'><A name=' round2'></A><u>  round2</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Like Math.round, but rounds negative numbers down (-5.5 -> -6).
     Math.round() actually rounds negative numbers up (-5.5 -> -5).
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.round2(num);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  num   (Number)  -- a real number.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (Number)  -- returns correctly rounded positive or negative numbers.
    </P>

				<P class='methodTitle'><A name=' formatDecimals'></A><u>  formatDecimals</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Formats a number into specified number of decimal places and 0 pad right.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.formatDecimals(num,digits);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  num   (Number)  -- a real number.</li>
<li>  digits   (Number)  -- a positive integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (String)  -- returns a string representation of a number into specified number of decimal places.
    </P>

				<P class='methodTitle'><A name=' toScientific'></A><u>  toScientific</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Convert any number to scientific notation with specified
     significant digits. (e.g.) .012345 -> 1.2345e-2 -- but 6.34e0
     is displayed "6.34" -- requires 'formatDecimals' method.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.toScientific(num,sigDigs);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  num   (Number)  -- a real number.</li>
<li>  sigDigs   (Number)  -- a positive integer.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (String)  -- returns a string representation of scientific notation with specified significant digits.
    </P>

				<P class='methodTitle'><A name=' numCurrency'></A><u>  numCurrency</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Unfinished method that introduces European formatting. I
     have included 'numCurrency2' that doesn't handle European
     formatting -- both versions are causing errors presently.
     </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.numCurrency(input,dig,bEuro,bCurr,sCurr);</pre>
     </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  input   (String)  -- allows for direct textfield input. </li>
<li>  dig   (Number)  -- a positive integer.</li>
<li>  bEuro   (Boolean)  -- if true, reverses delimit_arr.</li>
<li>  bCurr   (Boolean)  -- if false, returns a comma-delineated number.</li>
<li>  sCurr   (String)  -- country currency symbol.</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (String)  -- returns a string representation of the formatted currency.
    </P>

				<P class='methodTitle'><A name=' numCurrency2'></A><u>  numCurrency2</u></P>
				<P><span class='methodAttributesTitle'>description: </span>
				Working version for currency display that doesn't handle
	 European formatting.
	 </P>
				<P><span class='methodAttributesTitle'>usage:</span> <pre>Format.numCurrency(input,dig,curr);</pre>
	 </P>
<P> <span class='methodAttributesTitle'>parameters:</span><ul>
<li>  input   (String)  -- allows for direct textfield input.</li>
<li>  dig   (Number)  -- a positive integer.</li>
<li>  curr   (Array)  -- ["XYZ","Country Name",exchangeRateNum,decSeparatorNum(0-3),trebSeparatorNum(0-3)]</li>
</ul></P>
<P><span class='methodAttributesTitle'>returns:</span> (String)  -- returns a string representation of the formatted currency.
	</P>
</div>

			<BR>
			<BR>
			<HR class='big'>
			<span class="footer">generated with <A href='http://blog.klaustrofobik.org/' target='_blank'>AS2docGenerator beta 0.5.3</A></span>
			</BODY>
			</HTML>

